package com.demoo.zjsu.service.controllerservice;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.lang.reflect.Method;

/**
 * Created by jshjsh on 2016/8/14.
 */

@Transactional(rollbackFor = Exception.class)
@Service
public class TransactionService {

    @Autowired
    private Parameter parameter;

    public Object transactionController(Class dao, String method, Object...param){
        parameter.setParam(param);
        parameter.setDao(dao);
        parameter.setMethodName(method);
        return parameter.invoke();
    }



}
